Determining line leading in accordance with traditional Japanese practices

ABSTRACT

Method and apparatus, including computer program products, implementing and using techniques for controlling leading. A region including a plurality of lines in data being typeset and displayed on a display device is specified. One of the lines in the plurality of lines is selected, and a user input is received to set a new leading value (S 11 , S 12 ). The current leading value of the selected line is determined (S 13 ). The difference between the new leading value and the current leading value is determined (S 14 ). The spacing amount of the selected line based on the difference is adjusted. A desktop publishing system for controlling leading is also described.

TECHNICAL FIELD

The invention relates to desktop publishing (DTP) technology, and moreand more particularly to a typesetting technology for DTP.

BACKGROUND

In DTP using computers, data to be edited is displayed on a displaydevice, and layout and typesetting operations (i.e., charactertypesetting) are performed on this data based on user input. Intypesetting operations, “gyookuri” (leading in European-languagetypesetting), which is the relative positional relationship between aplurality of lines, is set. Leading is the distance between a line andthe next line when the line is displayed or printed, and thuscorresponds to the distance from one line's reference point to the nextline's reference point. Therefore, leading includes one line's “lineheight” and the “spacing amount” (i.e., interline spacing) between thatline and the next line.

However, there are situations in which the character data to be editedis not just Japanese but also a European language, and there aresituations in which the two are mixed together. Therefore a DTP systemneeds to be capable of processing European languages as well asJapanese, and to handle documents containing a mixture of Europeanlanguages and Japanese. When doing so, there are a number of points inwhich the typesetting rules for European language typesetting andJapanese typesetting differ, so automating DTP typesetting operationshas proven to be difficult, and conventional DTP using computers must beprocessed by many manual user operations. Leading in typesettingoperations is an example of a situation in which manual intervention bythe user at present is unavoidable, thus making the typesettingoperation difficult and complicated.

For example, in European language typesetting and conventional DTP,leading (i.e. “gyookuri” in Japanese) is set as a distance from acurrent line's baseline to a previous line's baseline. That is, as shownin FIG. 7A, in European-language typesetting two lines included in textframe 31 on the screen of a display device displaying data that isundergoing typesetting are coordinated and positioned on theirrespective baselines 29 and 30, and distance 32 between the first line'sbaseline and the next line's baseline corresponds to the leading.Therefore the top side of text frame 31, i.e. the top side of the firstline, is offset downward by exactly gap 33 from reference line 28 set inthe page.

On the other hand, FIG. 7B shows a case in which Japanese text isassigned inside text frame 35. As in FIG. 7A, this is a case in whichthe text is positioned according to the European-language baseline. Bothexamples are 24-point characters, and show a situation in which theresult of automatic leading setting is leading (e.g. leading 32 and 36)set to a 29-point dimension. Both text frame 31 and 35 are coordinatedon the European-language baseline. Nevertheless, the top side and thebottom side of the text frame 35 in FIG. 7B are vertically offset (e.g.gap 37 and 38) from the top side and bottom side of the text frame inFIG. 7A. In FIG. 7B, unlike the case in FIG. 7A, the top side of thetext frame, i.e. the top side of the first line, is coordinated withreference line 34 set in the page.

In nearly all electronic typesetting today leading is set with referenceto a baseline, so when the leading value of a current line is increased,for example, that line moves downward inside the text frame and ispositioned more distantly from the previous line. Nevertheless, changingthe current line's position by changing the leading value setting inthis manner is not desirable, particularly in Japanese typesetting, sothe user needs to manually correct the vertical position of one or morelines each time the set leading value changes.

SUMMARY

In general, in one aspect, the invention provides methods and apparatus,including computer program products, implementing and using techniquesfor controlling leading. A region including a plurality of lines of databeing typeset and displayed on a display device is selected. One of thelines in the plurality of lines is selected, and a user input isreceived to set a new leading value. The current leading value of theselected line is determined. The difference between the new leadingvalue and the current leading value is determined and the spacing amountof the selected line is adjusted based on the difference.

Implementations can include one or more of the following features. Linesbelow the selected line can be processed sequentially and continuously,subsequent to processing the selected line, until the next to last linein the plurality of lines. The leading value can be the distance betweenthe maximum height position of one line and the maximum height positionof the next line. The maximum height can be the maximum point dimensionamong the plurality of data point dimensions included in a line. Theleading value can be the sum of the height and spacing amount for oneline, the line height can be the maximum height of the line, and thespacing amount can be the distance between the bottom part of the lineand the maximum height position of the next line.

In general, in another aspect, the invention provides a desktoppublishing system implementing and using techniques for controllingleading. The desktop publishing system includes a desktop publishingprocessing control device that is provided with typesetting controlmeans, a display device displaying data being typeset and input meansfor user input. The typesetting control means have a leading controlmeans that is arranged to receive a user specification of a regionincluding a plurality of lines in the data being typeset, select one ofthe lines in the plurality of lines and set a new leading value for theselected line. Furthermore, the leading control means is arranged todetermine a consecutive line height and spacing amount for the selectedline and the next line, determine a current leading value and adjust acurrent spacing amount based on the new leading value and the currentleading value.

In general, in another aspect, the invention provides methods andapparatus, including computer program products, implementing and usingtechniques for controlling leading. A user specification of a regionincluding a plurality of lines in the data being typeset is received.One of the lines in the plurality of lines is selected. A new leadingvalue for the selected line is set. A consecutive line height andspacing amount for the selected line and the next line is determined. Acurrent leading value is determined and a current spacing amount isadjusted based on the new leading value and the current leading value.

Potential advantages of the invention may include one or more of thefollowing. The aforesaid defects of prior art may be eliminated in andleading control in electronic typesetting may be improved. A leadingcontrol technology for electronic typesetting can be provided that maymake it possible to automatically change all leading without requiringmanual adjustment by the user. A DTP system may be provided that canappropriately and swiftly set and change leading for text comprisingEnglish or Japanese or a mixture thereof. An improved leading controlmethod for electronic typesetting and a recording medium storing aleading control program may be provided.

The details of one or more implementations of the invention are setforth in the accompanying drawings and the description below. Otherfeatures, objects, and advantages of the invention will be apparent fromthe description and drawings, and from the claims.

DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic block diagram showing a DTP system capable ofcontrolling leading in accordance with one implementation of theinvention.

FIG. 2 is a schematic block diagram showing a DTP system capable ofcontrolling leading in accordance with another implementation of theinvention.

FIG. 3 is a schematic diagram explaining various parameters that areused when setting leading in the invention.

FIGS. 4A-4D are schematic diagrams showing a plurality of lines, to beset with new leading, arranged in a text frame displayed on the screenof a display device.

FIGS. 5A and 5B are flowcharts showing the leading control sequence inelectronic typesetting in accordance with one implementation of theinvention.

FIG. 6 is a schematic diagram showing embox 30 that is used whencontrolling leading in one implementation of the invention.

FIGS. 7A and 7B are schematic diagrams comparing the differences inEuropean language and Japanese when leading is set automatically inconventional electronic typesetting.

Like reference symbols in the various drawings indicate like elements.

DETAILED DESCRIPTION

FIG. 1 shows an electronic DTP processing system 1 in accordance withone implementation of the invention. DTP processing system 1 shown inFIG. 1 has a DTP processing control device 2, which can performelectronic typesetting and layout editing and so forth; a display device3 for displaying the data being processed; an input means 5 forinputting various types of data such as graphics, text, controlinstructions, etc.; and an output means 6 for outputting processed data.DTP processing control device 2 has typesetting control means 2 a, whichcontrols typesetting, and layout control means 2 b, which controlslayout editing. Typesetting control means 2 a has leading control means8, which automatically sets and changes leading for a plurality of linesin a region specified in the data being typeset in electronictypesetting.

Display device 3 can comprise various types of display devices such as aCRT or LCD, etc. Input means 5 can include a keyboard, pointing device(mouse, track ball, track point, etc.), scanner, communicationinterface, etc. In addition, output means 6 can comprise a printer,external memory device, etc. DTP processing control device 2 can consistof a processor such as a CPU, etc., or a memory, or an electronictypesetting processing program, etc. that includes a leading controlroutine that is loaded into memory and processed by a processor. On theother hand, DTP processing control device 2 can also be constituted inpart or in whole as hardware or firmware.

FIG. 2 is a block diagram showing a DTP system 10 provided with theleading processing function in accordance with the invention,constituted by applying the invention to a general-purpose computersystem. That is, system 10 shown in FIG. 2 has a CPU 11, a memory 12, aCRT 13, a hard disk 14, a keyboard 15, a mouse 16, a CD-ROM drive 17, aFD drive 18, and a printer 19. These units are connected and worktogether via a bus 9. In electronic typesetting in accordance with theinvention, a leading control program 8 is installed in system 10 viaCD-ROM drive 17 or FD drive 18, and stored on hard disk 14, for example.Then, when this leading control program 8 or an electronic typesettingprogram containing the leading control program are started by a useroperating keyboard 15 or mouse 16, the leading control program is loadedinto memory 12 as shown in the diagram. Therefore the leading controlmeans is constituted as CPU 11 and layout editing program 8 loaded intomemory 12. Therefore, in accordance with one aspect of the invention acomputer-readable recording medium (for example, CD-ROM, FD, tape,semiconductor memory, etc.) storing a leading control program isprovided so that a general-purpose computer system can be converted intoa DTP system providing the leading control function in accordance withthe invention.

FIG. 3 shows two lines to be set with the desired leading value inaccordance with the invention. The lines constitute part of data beingelectronically typeset that is displayed on the screen of display device3. Each line 20 is displayed on the page of an electronic documentdisplayed on the screen. Each line 20 has a plurality of cells 20 a,with each cell 20 a containing one character. Each line 20 has a toppart (top side) 20 b and a bottom part (bottom side) 20 c, and thedistance 23 in the vertical direction between the top part 20 b and thebottom part 20 c is the height of the line. The vertical distance 21between the first line's top part 20 b and the second line's top part isthe leading value for these lines. In addition, vertical distance 22between the first line's bottom part 20 c and the second line's top partis the spacing (interline spacing) amount. Therefore leading value 21 isdefined as the sum of line height 23 and spacing amount 22. Furthermore,one feature of the invention is that line height 23 and spacing amount22 are handled as two different quantities.

Furthermore, it should be noted that each line does not always containcharacters having the same font or dimensions; there are instances inwhich different fonts, particularly fonts including characters withdifferent dimensions, are included in a line. In such a situation theinvention determines the top part 20 b and the bottom part 20 c of aline according to the maximum height position and the minimum heightposition of the line, respectively. In this case one implementation ofthe invention uses the “embox” concept to regulate character arrangementwithin each line. As shown in FIG. 6, an embox is frame 40 surroundingglyph 42 (the character “a” in this case), and corresponds to aso-called “imaginary body.” Embox 40 is square in shape and the lengthof one side of the embox corresponds to the character's point dimensionH. Furthermore, FIG. 6 shows bounding box (surrounding box) 41surrounding glyph 42. The bounding box is defined by a pair of parallelhorizontal lines and a pair of parallel vertical lines that touch theoutermost points of glyph 42 in the vertical and horizontal directions.Bounding box 41 corresponds to the so-called “character face.” Theheight of embox 40 is the point dimension, and the point dimension isone of the attributes of glyph 42, so the height of a line can bedetermined by checking the point dimensions of all of the characters tobe included in the line. Also, in one implementation of the invention,the plurality of characters included within a line is arranged byaligning the bottom sides of the characters' emboxes 40 so in this casethe embox 40 of the character with the largest point dimension withinthe line projects upward compared to the others.

Next, the leading control function in accordance with one implementationof the invention will be explained with reference to FIGS. 4 and 5.

FIG. 4 schematically shows (a) through (d), which are within a pluralityof lines displayed within rectangular text frames on the page of anelectronic document that is undergoing electronic typesetting and isdisplayed on the screen of display device 3 (CRT 13). Furthermore, atext frame can be created as a rectangular region by the user selectinga text tool for text input from a tool box (not shown in drawings)displayed on the screen, for example, and moving the cursor on thescreen and determining the position of the cursor. Text can then bearranged within this text frame by typing and inputting the textdirectly into the text frame or by flowing the text in from anotherfile. In addition, part of text already present on the electronic pagecan be selected and inserted into the text frame. Values such as linelength and leading within the text frame are set as defaults or by usersettings. Therefore, when character data is input into a text frame,characters are arranged in each line and the separation between lines isset according to the set leading value as shown in FIG. 4 for therespective lines.

However, as described previously, each line does not always containcharacters that all have the same size (point dimension), and in thisimplementation the characters in each line are arranged with all oftheir embox bottom parts (bottom sides) aligned on a reference line (forexample, a horizontal line on a grid in the text frame), so for largecharacters have large emboxes, the emboxes project upwards compared tothe other emboxes for small characters. Therefore, in current line (a)in FIG. 4 the largest character is arranged near the end of the line,and the embox for that character projects upward compared to the emboxesfor the other characters, and the embox determines the line height Hi,and thus the maximum height position for that line. In addition, in thenext line (b) the largest character is positioned near the center of theline, and the embox for this character projects upward compared to theemboxes of the other characters, and the dimensions of this emboxregulates line height Hi, and thus the maximum height position of thatline. The spacing (i.e. interline spacing) Ai is determined between theposition of the bottom part of current line (a) and the maximum heightposition of the next line (b). The distance between the maximum heightposition of current line (a) and the maximum height position of nextline (b) is leading Li. As shown in FIG. 4, the largest character inlast line (d) is positioned near the end of that line, but in secondline from last (c) all of the characters in the line are the same size.

Next, an example of setting leading according to an electronictypesetting leading control procedure in accordance with animplementation of the invention will be explained with reference toFIGS. 5A and 5B. First, assume that the user operates input means 5,which is mouse 16, keyboard 15 or the like, and uses mouse 16 orkeyboard 15 to select (step S1) current line (a) (this does not alwayshave to be the first line in a text frame) shown in FIG. 4, among aplurality of lines displayed in a text frame, and sets a new leadingvalue for the plurality of lines from current line (a) through last line(d) (step S2). When this happens, the leading control means executes the“spacing calculation procedure” (step S3) shown in FIG. 5B anddetermines leading value Li set for the selected current line (a).

That is, as shown in the process in FIG. 5B, the leading control meansfinds the maximum size—for example, the maximum point dimension—withinselected current line (a), and determines the line's height Hi and theposition for the maximum height of the line (step S11). Next, theprocess finds the maximum size—for example, the maximum pointdimension—within the next line (b), and determines the height Hi+1 ofthat line and the position of the maximum height for that line (stepS12). The process then determines the leading value Li set for currentline (a) as the difference between the maximum height position ofcurrent line (a) and the maximum height position of next line (b)determined in this manner (step S13). Next, the process calculatesspacing amount Ai for current line (a) using the formula Ai=Li-Hi, fromthus determined leading value Li and previously determined line heightHi (step S14). Furthermore, if the process knows that the same leadingvalue was set for all of the lines, or if the leading value set for eachline can be input, a subroutine can be added to step S11 to branch tostep S14 after determining the line height Hi of the current line (a).

When the spacing amount Ai for the current line is determined asdescribed above, next, the leading value Li set for current line (a) andthe new leading value Ln are compared (step S4), and if the new leadingvalue Ln is larger, the difference ΔL between the new leading value Lnand the leading value Li is added to the spacing amount Ai for thecurrent line (step S5), while if the new leading value Ln is smaller,the difference ΔL between the leading value Li and the new leading valueLn is subtracted from the current spacing amount Ai for the current line(step S6), and as a result, a new leading value Ln is set for currentline (a).

Next, the processing is executed sequentially for the line followingline (b), and processing is continuously executed until line (c), thesecond line from (d), the last line in the frame. In this case, when thepreset leading value for all of the lines is already known, or when itis already known that all of the lines have the same leading value, onlythe height Hi for each line is determined, and a branch routine toadjust the spacing amount for each line by adding or subtracting Hi andthe already known leading value can be provided.

Therefore, the leading control mechanism in accordance with theinvention described above can set a new leading value and move only thelines following the selected line without moving the selected currentline. Leading can therefore be automatically set in electronictypesetting, which conventionally is done manually for Japanese, and theefficiency of typesetting operations can be increased. In addition, theposition of the selected current line does not change regardless ofwhether the leading value for the line is increased or decreased.

In addition, in another implementation of the invention the spacingamount Ai obtained at the top can be arranged for each line calculatedas described above or for appropriately selected lines. In this case,the current line moves upward or downward according to the size ofspacing amount Ai, which makes it possible to provide a function that isthe same as leading control referenced upon a baseline inEuropean-language typesetting.

A number of implementations of the invention have been described.Nevertheless, it will be understood that various modifications may bemade without departing from the spirit and scope of the invention.Accordingly, other implementations are within the scope of the followingclaims.

1. A computer-implemented method for controlling leading, composing:specifying a region including a plurality of lines of data being typesetand displayed on a display device, selecting one of the lines in theplurality of lines, and receiving user input to set a new leading valuefor the selected line; determining a current leading value of theselected line, where the current leading value is equal to the sum of aheight of the selected line and a spacing amount between the selectedline and a next line; determining the difference between the new leadingvalue and the current leading value; and adjusting the spacing amountbetween the selected line and the next line based on the difference sothat the sum of the height of the selected line and the adjusted spacingamount is equal to the new leading value set by the user.
 2. The methodof claim 1, further comprising processing sequentially and continuouslylines below the selected line subsequent to processing the selected lineuntil the next to last line in the plurality of lines.
 3. The method ofclaim 1, wherein the leading value is the distance between the maximumheight position of the selected line and the maximum height position ofthe next line.
 4. The method of claim 3, wherein the maximum height isthe maximum point dimension among the plurality of data point dimensionsincluded in that line.
 5. The method of claim 1, wherein the leadingvalue is the sum of the line height and spacing amount for one line, theline height is the maximum height of the line, and the spacing amount isthe distance between the bottom part of the line and the maximum heightposition of the next line.
 6. A computer program product, stored on amachine-readable medium, comprising instructions operable to cause aprogrammable processor to: specify a region including a plurality oflines of data being typeset and displayed on a display device, selectone of the lines in the plurality of lines, and receive user input toset a new leading value for the selected line; determine a currentleading value of the selected line, where the current leading value isequal to the sum of a height of the selected line and a spacing amountbetween the selected line and a next line; determine the differencebetween the new leading value and the current leading value; and adjustthe spacing amount between the selected line and the next line based onthe difference so that the sum of the height of the selected line andthe adjusted spacing amount is equal to the new leading value set by theuser.
 7. The product of claim 6, further comprising instructionsoperable to cause a programmable processor to process sequentially andcontinuously lines below the selected line subsequent to processing theselected line until the next to last line in the plurality of lines. 8.The product of claim 6, wherein the leading value is the distancebetween the maximum height position of the selected line and the maximumheight position of the next line.
 9. The product of claim 8, wherein themaximum height is the maximum point dimension among the plurality ofdata point dimensions included in that line.
 10. The product of claim 6,wherein the leading value is the sum of the height and spacing amountfor one line, the line height is the maximum height of the line, and thespacing amount is the distance between the bottom part of the line andthe maximum height position of the next line.
 11. A desktop publishingsystem for controlling leading, comprising: a desktop publishingprocessing control device provided with typesetting control means; adisplay device displaying data being typeset; and input means for userinput; where the typesetting control means includes a leading controlmeans that is arranged to: receive a user specification of a regionincluding a plurality of lines in the data being typeset, selecting oneof the lines in the plurality of lines, and setting a new leading valuefor the selected line; determine a line height for the selected line anda current spacing amount between the selected line and the next line;determine a current leading value, where the current leading value isequal to the sum of the determined line height and spacing amount; andadjusting the current spacing amount between the selected line and thenext line based on the new leading value and the current leading valueso that the sum of the line height of the selected line and an adjustedcurrent spacing amount is equal to the new leading value.
 12. A methodfor controlling leading, comprising: receiving a user specification of aregion including a plurality of lines in the data being typeset;selecting one of the lines in the plurality of lines; setting a newleading value for the selected line; determining a line height for theselected line and a current spacing amount between the selected line andthe next line; determining a current leading value, where the currentleading value is equal to the sum of the determined line height andspacing amount; and adjusting the current spacing amount between theselected line and the next line based on the new leading value and thecurrent leading value so that the sum of the line height of the selectedline and an adjusted current spacing amount is equal to the new leadingvalue.
 13. A computer program product, stored on a machine-readablemedium, comprising instructions operable to cause a programmableprocessor to: receive a user specification of a region including aplurality of lines in the data being typeset; select one of the lines inthe plurality of lines; set a new leading value for the selected line;determine a line height for the selected line and a current spacingamount between the selected line and the next line; determine a currentleading value, where the current leading value is equal to the sum ofthe determined line height and spacing amount; and adjust the currentspacing amount between the selected line and the next line based on thenew leading value and the current leading value so that the sum of theline height of the selected line and an adjusted current spacing amountis equal to the new leading value.
 14. A system comprising: a user inputdevice, a display, a memory device, and a processor programmed to:specify a region including a plurality of lines of data being typesetand displayed on a display device, selecting one of the lines in theplurality of lines, and receiving user input to set a new leading valuefor the selected line; determine a current leading value of the selectedline, where the current leading value is equal to the sum of a height ofthe selected line and a spacing amount between the selected line and anext line; determine the difference between the new leading value andthe current leading value; and adjust the spacing amount between theselected line and the next line based on the difference so that the sumof the height of the selected line and the adjusted spacing amount isequal to the new leading value set by the user.
 15. The system of claim14, where the processor is further programmed to: process sequentiallyand continuously lines below the selected line subsequent to processingthe selected line until the next to last line in the plurality of lines.16. The system of claim 14, wherein the leading value is the distancebetween the maximum height position of the selected line and the maximumheight position of the next line.
 17. The system of claim 16, whereinthe maximum height is the maximum point dimension among the plurality ofdata point dimensions included in that line.
 18. The system of claim 14,wherein the leading value is the sum of the line height and spacingamount for one line, the line height is the maximum height of the line,and the spacing amount is the distance between the bottom part of theline and the maximum height position of the next line.